/**
 * @file    gt_assert.h
 * @author  Giantec-Semi ATE
 * @brief   GT assert file
 * @version 0.1
 * 
 * @copyright Copyright (c) 2021 Giantec-Semi
 */

#ifndef GT98XX_DRIVERS_GT_ASSERT_H_
#define GT98XX_DRIVERS_GT_ASSERT_H_

#ifdef __cplusplus
  extern "C" {
#endif /* __cplusplus */

#ifdef USE_FULL_ASSERT
/**
 * @brief   The assert_param macro is used for function's parameters check.
 * @param   expr    If expr is false, it calls assert_failed function
 *                  which reports the name of the source file and the
 *                  source line number of the call that failed.
 *                  If expr is true, it returns no value.
 * @retval  None
 */
  #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/**
 * @brief   Reports the name of the source file and the source line number of the call that failed.
 * @param   file The name of the source file of the call that failed.
 * @param   line The source line number of the call that failed.
 * @retval  None
 */
  void assert_failed(uint8_t *file, uint32_t line);
#else
  #define assert_param(expr) ((void)0U)   ///< Do nothing if USE_FULL_ASSERT is not defined
#endif /* USE_FULL_ASSERT */

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* GT98XX_DRIVERS_GT_ASSERT_H_ */
